package cn.schoolwow.util.module.check.instanceList.flow.common;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;

import java.util.List;

public class CheckListNotEmptyFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        List list = (List) flowContext.getData("list");

        if(null==list||list.isEmpty()){
            flowContext.broken("列表为空");
        }
    }

    @Override
    public String name() {
        return "检查列表不能为空";
    }
}
